package com.itheima.reggie.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.reggie.domain.Employee;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 员工的持久层接口
 */
@Repository
public interface EmployeeMapper extends BaseMapper<Employee> {

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    Employee findByUsername(String username);

    /**
     * 根据姓名查询员工列表
     * @param name
     * @return
     */
    List<Employee> findByName(String name);

    /**
     * 保存
     * @param employee
     */
    void save(Employee employee);


    /**
     * 根据id查询
     * @param id
     * @return
     */
    Employee findById(Long id);

    /**
     * 更新
     * @param employee
     */
    void update(Employee employee);
}
